package com.wxy.service.Impl;


import com.wxy.dao.SecurityUserMapper;
import com.wxy.domain.SecurityUser;
import com.wxy.service.SecurityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 47868
 */
@Component("SecurityService")
public class SecurityServiceImpl implements SecurityService {
    @Autowired
    private SecurityUserMapper securityUserMapper;
    @Override
    public int InsertUser(SecurityUser securityUser) {
        String username=securityUser.getUsername();
        SecurityUser securityUser1=securityUserMapper.findByUsername(username);
        if(securityUser1!=null){
            return 0;
        }
        return securityUserMapper.insert(securityUser);
    }
}
